using SimpleObjectPool;
using UnityEngine;

public class ObjectPoolClass : MonoBehaviour
{
    void Start()
    {
        var fishPool = new PoolClass<Fish>(() => new Fish(), null, 100);
        Debug.LogError($"fishPool.CurCount:{fishPool.CurCount}");

        var fishOne = fishPool.Spawn();
        Debug.LogError($"fishPool.CurCount:{fishPool.CurCount}");

        fishPool.Return(fishOne);
        Debug.LogError($"fishPool.CurCount:{fishPool.CurCount}");

        for (int i = 0; i < 10; i++)
        {
            fishPool.Spawn();
        }
        Debug.LogError($"fishPool.CurCount:{fishPool.CurCount}");
    }
}

public class Fish
{

}